package cn.chengdu.mapper;

import cn.chengdu.entity.Patientinformation;
import cn.chengdu.entity.People;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 挂号信息表 Mapper 接口
 * </p>
 *
 * @author jobob
 * @since 2019-11-25
 */
@Mapper
public interface PatientinformationMapper extends BaseMapper<Patientinformation> {



    @Select({
            "select p.pname,w.patrdate,s.staname,d.deptype from hospital_public.people p LEFT JOIN \n" +
                    "outpatientDepartment.patientinformation w on p.pid=w.pid LEFT JOIN hospital_public.staffinfo s\n" +
                    "on w.staid=s.staid LEFT JOIN hospitalization.department d on s.depid=d.depid where p.pphone=#{pphone}"
    })
    List<Patientinformation> getxinxi(String pphone);
}
